package com.ruoyi.edu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;

import java.io.Serializable;
import java.util.Date;

/**
 * 微信用户对象 edu_user
 * 
 * @author niruichen
 * @date 2020-12-19
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("edu_user")
public class EduUser implements Serializable {

private static final long serialVersionUID=1L;


    /** 用户id */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /** openid */
    @Excel(name = "openid")
    private String openid;

    /** 用户昵称 */
    @Excel(name = "用户昵称")
    private String nickname;

    /** 用户性别 */
    @Excel(name = "用户性别")
    private Boolean sex;

    /** 用户头像 */
    @Excel(name = "用户头像")
    private String avatar;

    /** 所在城市 */
    @Excel(name = "所在城市")
    private String city;

    /** 个性签名 */
    @Excel(name = "个性签名")
    private String sign;

    /** 用户状态 */
    @Excel(name = "用户状态")
    private Integer disabled;

    /** 最近登录 */
    @Excel(name = "最近登录" , width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date lastLoginTime;

    /** 逻辑删除 */
    @Excel(name = "逻辑删除")
    @TableLogic
    private Integer deleted;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 修改时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    //把敏感数据致为空
    public void setNull() {
        id = null;
        openid = null;
    }
}
